package com.vr.caricature.http;


/**
 * author: Shoxz.Cheng
 * Date: 2016-08-31
 * Time: 10:53
 */
public class HttpMethods {

//    public static final String BASE_URL = "https://api.douban.com/v2/movie/";
//
//    private static final int DEFAULT_TIMEOUT = 5;
//
//    private Retrofit retrofit;
////    private MovieService movieService;
//
//    //构造方法私有
//    private HttpMethods() {
//        //手动创建一个OkHttpClient并设置超时时间
//        OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder();
//        httpClientBuilder.connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS);
//
//        retrofit = new Retrofit.Builder()
//                .client(httpClientBuilder.build())
//                .addConverterFactory(GsonConverterFactory.create())
//                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                .baseUrl(BASE_URL)
//                .build();
//
////        movieService = retrofit.create(MovieService.class);
//    }
//
//    //在访问HttpMethods时创建单例
//    private static class SingletonHolder{
//        private static final HttpMethods INSTANCE = new HttpMethods();
//    }
//
//    //获取单例
//    public static HttpMethods getInstance(){
//        return SingletonHolder.INSTANCE;
//    }
//
//    /**
//     * 用于获取豆瓣电影Top250的数据
//     * @param subscriber 由调用者传过来的观察者对象
//     * @param start 起始位置
//     * @param count 获取长度
//     */
////    public void getTopMovie(Subscriber<MovieEntity> subscriber, int start, int count){
////        movieService.getTopMovie(start, count)
////                .subscribeOn(Schedulers.io())
////                .unsubscribeOn(Schedulers.io())
////                .observeOn(AndroidSchedulers.mainThread())
////                .subscribe(subscriber);
////    }





}
